<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:choose>
    <c:when test="${empty records}">
        工件${ebom.eName}（${ebom.code}）暂未进行工艺参数记录，<a href="${pageContext.request.contextPath}/app/api/lab/index?eBomId=${ebom.id}">开始进行工艺参数记录</a>
    </c:when>
    <c:otherwise>
        <div class="big-title mt20">工件“${ebom.eName}（${ebom.code}）”的工艺历史查询</div>
        <table class="history-holder">
            <tr>
                <td colspan="2" class="content-middle-top">
                    <i class="line"></i>
                </td>
            </tr>
            <c:forEach items="${records}" var="record" varStatus="i">
                <c:choose>
                    <c:when test="${i.index % 2 == 0}">
                        <tr class="content-left">
                            <td class="content-h">
                                <div class="history-content">
                                    <i class="arraw"></i>

                                    <div class="inner">
                                        <dl style="overflow: hidden;margin-bottom: 0">
                                            <dt class="wh80 float-left">
                                                <img src="${pageContext.request.contextPath}/print/${record.tProcessTemplate.processCover}"
                                                     style="width: 80px;height: 80px"/>
                                            </dt>
                                            <dd class="ml90">
                                                <div style="position: relative;top: -10px;">
                                                    <span class="title font18">${record.tProcessTemplate.processName}</span>
                                                    <a data-ref="${record.id}" data-id="view" class="ml10"
                                                       iconCls="fa fa-eye fa-lg" plain="true">查看</a>
                                                    <c:if test="${record.updatePermission}">
                                                        <a data-ref="${record.id}" data-id="edit" class="ml10"
                                                           iconCls="fa fa-edit fa-lg" plain="true">修改</a>
                                                    </c:if>
                                                </div>
                                                <div>
                                                    <span class="title">操作人员：</span>${record.operator}
                                                </div>
                                                <div class="mt5">
                                                    <span class="title">操作结果：</span>${record.result}
                                                </div>
                                                <c:if test="${not empty record.updateTime}">
                                                    <div class="mt5">
                                                        <span class="title">最近修改：</span><fmt:formatDate
                                                            value="${record.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                                    </div>
                                                </c:if>
                                            </dd>
                                        </dl>
                                    </div>
                                </div>
                            </td>
                            <td class="content-h">
                                <div class="handler">
                                    <div class="timer">
                                                <span><fmt:formatDate value="${record.operateTime}"
                                                                      pattern="yyyy年MM月dd日"/> </span>
                                                <span><fmt:formatDate value="${record.operateTime}"
                                                                      pattern="HH时mm分ss秒"/></span>
                                    </div>
                                    <i class="line"></i>
                                    <i class="cycle-outter">
                                        <i class="cycle"></i>
                                    </i>
                                </div>
                            </td>
                        </tr>
                    </c:when>
                    <c:otherwise>
                        <tr class="content-right">
                            <td class="content-h">
                                <div class="handler">
                                    <div class="timer">
                                                <span><fmt:formatDate value="${record.operateTime}"
                                                                      pattern="yyyy年MM月dd日"/> </span>
                                                <span><fmt:formatDate value="${record.operateTime}"
                                                                      pattern="HH时mm分ss秒"/></span>
                                    </div>
                                    <i class="line"></i>
                                    <i class="cycle-outter">
                                        <i class="cycle"></i>
                                    </i>
                                </div>
                            </td>
                            <td class="content-h">
                                <div class="history-content">
                                    <i class="arraw"></i>

                                    <div class="inner">
                                        <dl style="overflow: hidden;margin-bottom: 0">
                                            <dt class="wh80 float-left">
                                                <img src="${pageContext.request.contextPath}/print/${record.tProcessTemplate.processCover}"
                                                     style="width: 80px;height: 80px"/>
                                          </dt>
                                            <dd class="ml90">
                                                <div style="position: relative;top: -10px;">
                                                    <span class="title font18">${record.tProcessTemplate.processName}</span>
                                                    <a data-ref="${record.id}" data-id="view" class="ml10"
                                                       iconCls="fa fa-eye fa-lg" plain="true">查看</a>
                                                    <c:if test="${record.updatePermission}">
                                                        <a data-ref="${record.id}" data-id="edit" class="ml10"
                                                           iconCls="fa fa-edit fa-lg" plain="true">修改</a>
                                                    </c:if>
                                                </div>
                                                <div>
                                                    <span class="title">操作人员：</span>${record.operator}
                                                </div>
                                                <div class="mt5">
                                                    <span class="title">操作结果：</span>${record.result}
                                                </div>
                                                <c:if test="${not empty record.updateTime}">
                                                    <div class="mt5">
                                                        <span class="title">最近修改：</span><fmt:formatDate
                                                            value="${record.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                                    </div>
                                                </c:if>
                                            </dd>
                                        </dl>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </c:otherwise>
                </c:choose>
            </c:forEach>
        </table>
    </c:otherwise>
</c:choose>
